<template>
  <div class="app-container">
    <div v-for="(item,index) in tempData" :key="index">
      <div class="change">
        <el-divider content-position="left">发货单信息：({{item.wuliaomingcheng}})</el-divider>
        <p>
          <span>单据号：</span>
          <span>{{item.danjuhao}}</span>
        </p>
        <p>
          <span>发货日期：</span>
          <span>{{item.danjuriqi}}</span>
        </p>
        <p>
          <span>业务员：</span>
          <span>{{item.yewuyuan}}</span>
        </p>
        <p>
          <span>运输方式：</span>
          <span>{{item.fangshi}}</span>
        </p>
        <p>
          <span>收获客户：</span>
          <span>{{item.shouhuokehu}}</span>
        </p>
        <p>
          <span>物料名：</span>
          <span>{{item.wuliaomingcheng}}</span>
        </p>
        <p>
          <span>包装物：</span>
          <span>{{item.bzw}}</span>
        </p>
        <p>
          <span>数量：</span>
          <span>{{item.shuliang}}</span>
        </p>
        <p>
          <span>含税单价：</span>
          <span>{{item.hanshuidanjia}}</span>
        </p>
        <p>
          <span>价税合计：</span>
          <span>{{item.jiashuiheji}}</span>
        </p>
        <p>
          <span>打托缠膜：</span>
          <span>{{item.chanmofeiyong}}</span>
        </p>
        <p>
          <span>运输单价：</span>
          <span>{{item.yunshudanjia}}</span>
        </p>
        <p>
          <span>包装费用：</span>
          <span>{{item.bhbz}}</span>
        </p>
        <p>
          <span>新客户：</span>
          <span>{{item.shifouweixinkehu}}</span>
        </p>
        <p>
          <span>佣金：</span>
          <span>{{item.yongjin}}</span>
        </p>
        <p>
          <span>收款协议：</span>
          <span>{{item.shoukuanxieyi}}</span>
        </p>
        <p>
          <span>佣金比例：</span>
          <span>{{item.yongjinbili}}</span>
        </p>
      </div>
      <!-- <div class="change" v-if="item.huikuanList.length != 0">
        <el-divider content-position="left">回款单信息：</el-divider>
        <el-table
          :data="item.huikuanList"
          style="width: 100%;border-radius: 8px;"
        >
          <el-table-column align="center" prop="huikuanriqi" label="回款日期" />
          <el-table-column align="center" prop="xingming" label="业务员" />
          <el-table-column align="center" prop="kehumingcheng" label="收获客户" />
          <el-table-column align="center" prop="jine" label="回款金额" />
          <el-table-column align="center" prop="jine2" label="回款备份" />
          <el-table-column align="center" prop="chengduiriqi" label="承兑日期" />
          <el-table-column align="center" prop="insertTime" label="导入时间" />
        </el-table>
      </div> -->
    </div>
    <div class="submits">
      <!-- <div class="nosave" @click="nosaveOrder">取消</div> -->
      <div class="save" :class="isClick ? 'disable' : ''" @click="save">开始计算</div>
    </div>
  </div>
</template>

<script>
import { jisuanxslist } from '@/api/neimao'
export default {
  data() {
    return {
      tempData: {},
      islook: false,
      tableData: [],
      fileNum: [],
      isClick: false,
      twoClassify: [],
      writeOradd: 0 //新增0，编辑1
    };
  },
  mounted() {
    // this.cangkuList();
    console.log(this.$route.params);
    this.tempData = JSON.parse(this.$route.params.options);
    console.log(this.tempData);
  },
  methods: {
    downLoad(filepath) {
      window.location.href = filepath;
    },
    nosaveOrder() {
      this.$router.go(-1);
    },
    back() {
      this.$router.go(-1);
    },
    save() {
      this.isClick = true
      console.log(this.tempData);
      const str = JSON.stringify(this.tempData)
      console.log('str',str)
      jisuanxslist(str).then(res => {
        console.log(res)
        this.$message({
          message: res.message,
          type: 'success'
        })
        this.$router.push({
          name: 'Neiyijisuan'
        })
      })
    }
  }
};
</script>

<style scoped lang="scss">
.ellisp {
  width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-align: left;
}
.proimg {
  width: 100px;
  height: 100px;
}
.zishebei {
  background: #fff;
  padding: 20px;
  border-radius: 0 0 8px 8px;
}
.change {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px 8px 0 0;
  padding: 20px;
  > p {
    width: 33%;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: block;
      width: 120px;
      text-align: right;
      padding-right: 15px;
      &:last-child {
        text-align: left;
        color: #888;
        flex: 1;
      }
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
  }
}
.submits {
  display: flex;
  padding: 15px 20px;
  background: #fff;
  margin-top: 20px;
  border-radius: 8px;
  justify-content: flex-end;
  align-items: center;
  > div {
    width: 80px;
    height: 32px;
    text-align: center;
    line-height: 32px;
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    margin-left: 30px;
    cursor: pointer;
  }
  .add {
    background: #18a05e;
  }
  .save {
    background: #2196f3;
  }
  .nosave {
    background: #999;
  }
}
.fileup {
  position: relative;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  // align-items: center;
  justify-content: space-between;
  .uping {
    width: 49%;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    border-radius: 5px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
    > p {
      width: 90%;
      font-size: 14px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      color: #333;
      /deep/.el-input__inner {
        // width: inherit;
        background: none;
        height: 32px;
        // line-height: 32px;
        color: #333;
        border: 1px solid rgba(0, 0, 0, 0.1);
        padding: 0 25px;
      }
      /deep/.el-input__icon {
        line-height: 32px;
      }
      /deep/.el-upload-dragger {
        width: 100%;
        height: 100px;
      }
      /deep/.el-upload-dragger .el-icon-upload {
        font-size: 60px;
        color: #c0c4cc;
        margin: 0;
        line-height: 1;
        width: 100%;
      }
      /deep/.el-upload {
        width: 100%;
      }
      .userselect {
        // max-width: 250px;
        flex: 1;
      }

      > span {
        display: block;
        width: 100px;
        text-align: right;
        padding-right: 15px;
        &:last-child {
          text-align: left;
          color: #888;
        }
      }
      > input {
        width: inherit;
        flex: 1;
        height: 32px;
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        padding-left: 10px;
        color: #333;
      }
      > strong {
        display: inline-block;
        padding-right: 50px;
        font-weight: 100;
        font-size: 14px;
        &:last-child {
          cursor: pointer;
          color: #13ce66;
          font-weight: 600;
        }
      }
      > div {
        width: inherit;
        flex: 1;
      }
    }
  }
}
.zd3-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  // border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .el-pagination {
    white-space: nowrap;
    padding: 15px 5px;
    color: #303133;
    font-weight: bold;
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.25);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
</style>
